package cn.biplam.back.operator.systemManage.sysprivi.role;

import cn.biplam.back.operator.systemManage.sysprivi.role.table.RoleOpt;
import cn.biplam.back.operator.systemManage.sysprivi.role.table.RolePriviOpt;
import cn.biplam.common.client.OperatorResult;
import cn.biplam.common.interfaces.DataOperator;
import cn.biplam.common.opcode.SysManageCode.RoleOptCode;
import cn.biplam.common.opcode.SysManageCode.RolePriviOptCode;
import cn.biplam.common.wrapper.ErrorMessage;

/**
 *  角色管理操作交换
 * @author XiaoRuxing Dec 9, 20093:04:17 PM
 * @version 1.0
 */
public class RoleMgOpt extends DataOperator{

	public static final String Op_ID = "2815";
	
	/** 角色表操作 */
	public static final String Role = RoleOptCode.Op_ID;
	/** 角色权限表操作 */
	public static final String Role_Privi = RolePriviOptCode.Op_ID;
	
	public RoleMgOpt() throws ErrorMessage {
		super();
	}

	@Override
	protected OperatorResult _exchange() throws ErrorMessage {
		String exchangeId = opId.substring(0, 5);
		if(Role.equals(exchangeId)){
			return new RoleOpt().get(opId, userId, filter, dbResource);
		}else if(Role_Privi.equals(exchangeId)){
			return new RolePriviOpt().get(opId, userId, filter, dbResource);
		}else{
			throw new ErrorMessage("Operator Exchange outport not found:"+ opId+" !");
		}
	}

}
